package com.junmo.fanbizhidemo.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.junmo.fanbizhidemo.R;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by huruihua on 2017/11/29.
 */

public class HengXiangAdapter extends BaseRecyclerAdapter<String> {

    private Context context;

    @Override
    public RecyclerView.ViewHolder onCreate(ViewGroup parent, int viewType) {
        context = parent.getContext();
        return new HengXiangHolder(LayoutInflater.from(context).inflate(R.layout.item_henxiang_layout, parent, false));
    }

    @Override
    public void onBind(RecyclerView.ViewHolder viewHolder, int realPosition, String data) {
        if (viewHolder instanceof HengXiangHolder) {
            HengXiangHolder holder = (HengXiangHolder) viewHolder;

            holder.itemHenxiangText.setText(data);
        }
    }

    class HengXiangHolder extends Holder {
        @BindView(R.id.item_henxiang_text)
        TextView itemHenxiangText;

        public HengXiangHolder(View itemView) {
            super(itemView);
            ButterKnife.bind(this, itemView);
        }
    }


}
